package samples.d2.shapes 
{
	import flash.filters.DropShadowFilter;
	import flash.filters.GlowFilter;
	import flash.geom.Rectangle;
	import flash.utils.setInterval;
	import samples.BaseSample;
	import shapes.shapes2D.distribution.goldenRatio.GoldenRatio;
	import shapes.shapes2D.distribution.Grid;
	import shapes.shapes2D.Dot;
	import shapes.shapes2D.Square;
	
	/**
	 * @author Nicolas Barradeau
	 * http://en.nicoptere.net
	 */
	public class Square6 extends BaseSample
	{
		private var s:Square;
		public function Square6() 
		{
			
			s = new Square(0, 0, 0);
			reset();
			//setInterval( reset, 10 );
			
		}
		
		private function reset():void
		{
			
			graphics.clear();
			graphics.lineStyle( 0,color );
			var i:int;
			for (i = 100; i < sw - 100; i+=80 )
			{
				
				pattern( i, sh / 2, 80 );
				
			}
		}
		
		private function pattern( x:Number, y:Number, size:Number = 10  ):void
		{
			
			var step:Number = s.size = size / 5;
			
			graphics.lineStyle( 0,0 );
			graphics.beginFill( color );
			
			var i:int, j:int;
			i = 5;
			while ( i-- )
			{
				s.x = x + i * step;
				s.y = y;
				s.draw( graphics );
						
				j = 4;
				while ( j-- )
				{
					if ( i == 0 && j > 0 )
					{
						s.y = y + j * step;
						s.draw( graphics );
					}
					
					if ( ( i == 1 || i == 2 ) && j == 3 )
					{
						s.y = y + j * step;
						s.draw( graphics );
					}
				}
			}
			
		}
		
	}

}